<template>
  <div class="details" v-if="dataInfo">
    <x-header>{{dataInfo.name}} <router-link to="/" slot="right"> <a class="fa fa-home fa-15x"></a> </router-link></x-header>
     <ul>
       <li class="item" v-for="(item,index) in dataInfo.children" :key="index">
         <div class="name">{{item.name}}</div>
         <div class="cotent">
           <ab-upload multiple :itemId="item.id" :taskId="taskId"></ab-upload>
           <!-- 参数配置multiple 是否支持多选  默认单选
           itemId 项目的id 约定的特殊标识-->
         </div>
       </li>
     </ul>
  </div>
</template>

<script>
import Vue from "vue"
import setting from "@/setting"
import abUpload from "@/components/form/abUploadGz"
export default {
  created () {
    let dataInfo = this.$route.params.data
    let taskId = this.$route.params.taskId
    if (dataInfo && taskId) {
      this.dataInfo = dataInfo
      this.taskId = taskId
      window.sessionStorage.setItem('dataInfo',JSON.stringify(this.dataInfo))
      window.sessionStorage.setItem('taskId',this.taskId)
    } else {
      let newData = window.sessionStorage.getItem('dataInfo')
      let newTaskId = window.sessionStorage.getItem('taskId')
      if (newData && newTaskId) {
        this.dataInfo = JSON.parse(newData)
        this.taskId = newTaskId
      }
    }
  },
  methods: {

  },
  destroyed () {
    window.sessionStorage.removeItem('dataInfo')
    window.sessionStorage.removeItem('taskId')
  },
  mounted () {

  },
  name: "gaTypeinDetails",
  data() {
    return {
      dataInfo: null,
      taskId: null
    }
  },
  components: {
   abUpload
  }
};
</script>

<style scoped lang="less">
.details{
  .item{
    padding: 10px;
    border-bottom: 1px solid #ddd;
    align-items: center;
    display: flex;
    &:last-child{
      border-bottom:none
    }
    >div{
      display: inline-block;
      vertical-align: middle;
    }
    .name{
      margin-right: 10px;
      width: 25%;
    }
  }
}
</style>
